/**
 * Copyright 2007-2008. Chongqing First Information & Network Co., Ltd. All
 * rights reserved. <a>http://www.cqfirst.com.cn</a>
 */
package com.cqcis.uip.base.framework.common;

import java.util.HashSet;
import java.util.Set;

/**
 * 服务角色定义(即服务类型): 
 *  socket客户端
 *  socket服务端
 *  数据库表 ........
 *  
 * @author huangmy
 * @date   2007-12-10
 */
public enum Role {	
	CUSTOMIZED("Customized"), /*定制类型*/
	COMMON("Common"), /*通用类型*/
    SOCKET_SERVER("Socket Server"),        /*socket服务端*/
    SOCKET_CLIENT("Socket Client"),        /*socket客户端*/
    HTTP_CLIENT("Http Client"),        /*http客户端*/
    HTTP_SERVER("Http Server"),        /*http服务端*/
    FTP_CLIENT("Ftp Client"),        /*ftp客户端*/
    FTP_SERVER("Ftp Server"),        /*ftp服务端*/
    TELNET_CLIENT("Telnet Client"),        /*telnet客户端*/
    TELNET_SERVER("Telnet Server"),        /*telnet服务端*/
    TABLE("Table Dispatch"),         /*数据库表*/
    HTTPINVOKER_EXPORT("HttpInvoker Export"),         /*HttpInvoker 发布者*/
    WEBAPP("Webapp"),         /*Webapp 发布者*/
	WEBSERVICE_PUBLISHER("Webservice Publisher"),         /*webservice发布者*/
	WEBSERVICE_CALLER("Webservice Caller");         /*webservice调用者*/
	
	/**
	 *  多个角色实现类, 该范围内的Role可以多次标注
	 */
	public static Set<Role> RolesMultiTypes = new HashSet<Role>();
	static {
		RolesMultiTypes.add(HTTPINVOKER_EXPORT);
	}
	
    private String name;
    
    Role(String name) {
    	this.name = name;
    }
    
    @Override
    public String toString() {    	
    	return name;
    }
}
